package com.situ.wms.controller;
import java.io.IOException;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.situ.wms.entity.GoodsNotes;
import com.situ.wms.impl.GoodsNotesServiceImpl;
import com.situ.wms.service.GoodsNotesService;
import com.situ.wms.util.BaseController;
import com.situ.wms.vo.LayuiTable;

@WebServlet("/goodsnotes")
public class GoodsNotesController extends BaseController {
	private static final long serialVersionUID = 1L;
		GoodsNotesService service = new GoodsNotesServiceImpl();
	public void page( HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		request.getRequestDispatcher("/WEB-INF/notesindex.jsp").forward(request, response);
	}
	public LayuiTable list(Integer page,Integer limit,String keyword) {	
				List<GoodsNotes>list=service.selectByname(page,limit,keyword);
				//造一个前台解析格式的vo对象
		
				LayuiTable vo =new LayuiTable();
				vo.setCode(0);
				vo.setData(list);
	 			vo.setCount(service.count(keyword));//统计具体几条返回
	 			return vo; 
	}
	public LayuiTable list2(Integer page,Integer limit,String keyword) {	
				System.out.println(keyword);
				List<GoodsNotes>list=service.selectBytime(page,limit,keyword);
				//造一个前台解析格式的vo对象
				LayuiTable vo =new LayuiTable();
				vo.setCode(0);
				vo.setData(list);
	 			vo.setCount(service.countByDate(keyword));//统计具体几条返回
	 			return vo; 
	}
	
}
